<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilsecure: XilSecure ECDSA Client APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilsecure
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__xsecure__ecdsa__client__apis.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">XilSecure ECDSA Client APIs</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga0e90d7253656c56458e39541009e4954"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__ecdsa__client__apis.html#ga0e90d7253656c56458e39541009e4954">XSecure_GenSharedSecret</a> (XSecure_ClientInstance *InstancePtr, u32 CrvType, const u8 *PrivateKey, const u8 *PublicKey, u8 *SharedSecret)</td></tr>
<tr class="memdesc:ga0e90d7253656c56458e39541009e4954"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sends IPI request to generate shared secret using Elliptic Curve Diffie–Hellman Key Exchange (ECDH)  <a href="#ga0e90d7253656c56458e39541009e4954">More...</a><br/></td></tr>
<tr class="separator:ga0e90d7253656c56458e39541009e4954"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga640d4ab0cd1edb783d2d0a8c2af44ef5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__ecdsa__client__apis.html#ga640d4ab0cd1edb783d2d0a8c2af44ef5">XSecure_EllipticGenerateSign</a> (XSecure_ClientInstance *InstancePtr, u32 CurveType, u64 HashAddr, u32 Size, u64 PrivKeyAddr, u64 EPrivKeyAddr, u64 SignAddr)</td></tr>
<tr class="memdesc:ga640d4ab0cd1edb783d2d0a8c2af44ef5"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sends IPI request to generate elliptic signature for a given hash and curve type.  <a href="#ga640d4ab0cd1edb783d2d0a8c2af44ef5">More...</a><br/></td></tr>
<tr class="separator:ga640d4ab0cd1edb783d2d0a8c2af44ef5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga623ff4e3a9216677e7b5abe2767790a8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__ecdsa__client__apis.html#ga623ff4e3a9216677e7b5abe2767790a8">XSecure_EllipticGenerateKey</a> (XSecure_ClientInstance *InstancePtr, u32 CurveType, u64 PrivKeyAddr, u64 PubKeyAddr)</td></tr>
<tr class="memdesc:ga623ff4e3a9216677e7b5abe2767790a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sends IPI request to generate Public Key for a given curve type.  <a href="#ga623ff4e3a9216677e7b5abe2767790a8">More...</a><br/></td></tr>
<tr class="separator:ga623ff4e3a9216677e7b5abe2767790a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4e7f8b3452f7f23b4591cc21f1806b54"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__ecdsa__client__apis.html#ga4e7f8b3452f7f23b4591cc21f1806b54">XSecure_EllipticValidateKey</a> (XSecure_ClientInstance *InstancePtr, u32 CurveType, u64 KeyAddr)</td></tr>
<tr class="memdesc:ga4e7f8b3452f7f23b4591cc21f1806b54"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sends IPI request to validate the public key for a given curve type.  <a href="#ga4e7f8b3452f7f23b4591cc21f1806b54">More...</a><br/></td></tr>
<tr class="separator:ga4e7f8b3452f7f23b4591cc21f1806b54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga88eea76778dab99a54821e2117a3034e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__ecdsa__client__apis.html#ga88eea76778dab99a54821e2117a3034e">XSecure_EllipticVerifySign</a> (XSecure_ClientInstance *InstancePtr, u32 CurveType, u64 HashAddr, u32 Size, u64 PubKeyAddr, u64 SignAddr)</td></tr>
<tr class="memdesc:ga88eea76778dab99a54821e2117a3034e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sends IPI request to verify signature for a given hash, key and curve type.  <a href="#ga88eea76778dab99a54821e2117a3034e">More...</a><br/></td></tr>
<tr class="separator:ga88eea76778dab99a54821e2117a3034e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga623ff4e3a9216677e7b5abe2767790a8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_EllipticGenerateKey </td>
          <td>(</td>
          <td class="paramtype">XSecure_ClientInstance *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>CurveType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>PrivKeyAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>PubKeyAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sends IPI request to generate Public Key for a given curve type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>Pointer to the client instance </td></tr>
    <tr><td class="paramname">CurveType</td><td>Type of elliptic curve </td></tr>
    <tr><td class="paramname">PrivKeyAddr</td><td>Address of the static private key </td></tr>
    <tr><td class="paramname">PubKeyAddr</td><td>Address of the buffer where public key to be stored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS On success</li>
<li>XST_FAILURE On failure </li>
</ul>
</dd></dl>
<p>Perform input parameter validation on InstancePtr. Return XST_FAILURE if input parameters are invalid</p>
<p>Send an IPI request to the PLM by using the CDO command to call XSecure_EllipticGenKey API and returns the status of the IPI response.</p>

<p>References <a class="el" href="group__xsecure__common__apis.html#gga48921cbba3a5713caf7d975bedbe36acaeab0747eb84fba76e285132d85fae1c4">XSECURE_API_ELLIPTIC_GENERATE_KEY</a>, and <a class="el" href="group__xsecure__mailbox__apis.html#ga6ac5f0da32dd8fb5fcd15a7e65b492bb">XSecure_ProcessMailbox()</a>.</p>

</div>
</div>
<a class="anchor" id="ga640d4ab0cd1edb783d2d0a8c2af44ef5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_EllipticGenerateSign </td>
          <td>(</td>
          <td class="paramtype">XSecure_ClientInstance *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>CurveType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>HashAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>PrivKeyAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>EPrivKeyAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>SignAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sends IPI request to generate elliptic signature for a given hash and curve type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>Pointer to the client instance </td></tr>
    <tr><td class="paramname">CurveType</td><td>Type of elliptic curve </td></tr>
    <tr><td class="paramname">HashAddr</td><td>Address of the hash for which sign has to be generated </td></tr>
    <tr><td class="paramname">Size</td><td>Length of the hash in bytes </td></tr>
    <tr><td class="paramname">PrivKeyAddr</td><td>Address of the static private key </td></tr>
    <tr><td class="paramname">EPrivKeyAddr</td><td>Address of the Ephemeral private key </td></tr>
    <tr><td class="paramname">SignAddr</td><td>Address of the signature buffer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS On success</li>
<li>XST_FAILURE On failure </li>
</ul>
</dd></dl>
<p>Perform input parameter validation on InstancePtr. Return XST_FAILURE if input parameters are invalid</p>
<p>Link shared memory of size EcdsaParams to EcdsaParams structure for IPI usage. Validates the size of the shared memory whether the required size is available or not.</p>
<p>Send an IPI request to the PLM by using the CDO command to call XSecure_EllipticGenSign API and returns the status of the IPI response.</p>

<p>References <a class="el" href="group__xsecure__common__apis.html#gga48921cbba3a5713caf7d975bedbe36aca1eebf4899c7d95eb160c8a83d4c780f8">XSECURE_API_ELLIPTIC_GENERATE_SIGN</a>, <a class="el" href="group__xsecure__common__apis.html#ga4dc28d692c8e56b1837e73a956ddec26">XSecure_DCacheFlushRange</a>, and <a class="el" href="group__xsecure__mailbox__apis.html#ga6ac5f0da32dd8fb5fcd15a7e65b492bb">XSecure_ProcessMailbox()</a>.</p>

</div>
</div>
<a class="anchor" id="ga4e7f8b3452f7f23b4591cc21f1806b54"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_EllipticValidateKey </td>
          <td>(</td>
          <td class="paramtype">XSecure_ClientInstance *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>CurveType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>KeyAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sends IPI request to validate the public key for a given curve type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>Pointer to the client instance </td></tr>
    <tr><td class="paramname">CurveType</td><td>Type of elliptic curve </td></tr>
    <tr><td class="paramname">KeyAddr</td><td>Address of the public key to be validated</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS On success</li>
<li>XST_FAILURE On failure </li>
</ul>
</dd></dl>
<p>Perform input parameter validation on InstancePtr. Return XST_FAILURE if input parameters are invalid</p>
<p>Send an IPI request to the PLM by using the CDO command to call XSecure_EllipticValidatePubKey API and returns the status of the IPI response.</p>

<p>References <a class="el" href="group__xsecure__common__apis.html#gga48921cbba3a5713caf7d975bedbe36aca01c0ab6477c532f187b729665036b0b8">XSECURE_API_ELLIPTIC_VALIDATE_KEY</a>, and <a class="el" href="group__xsecure__mailbox__apis.html#ga6ac5f0da32dd8fb5fcd15a7e65b492bb">XSecure_ProcessMailbox()</a>.</p>

<p>Referenced by <a class="el" href="group__xsecure__kat__server__apis.html#ga0bc8cabf909b4a457656573b4b701c3a">XSecure_EllipticVerifySignKat()</a>.</p>

</div>
</div>
<a class="anchor" id="ga88eea76778dab99a54821e2117a3034e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_EllipticVerifySign </td>
          <td>(</td>
          <td class="paramtype">XSecure_ClientInstance *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>CurveType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>HashAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>PubKeyAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>SignAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sends IPI request to verify signature for a given hash, key and curve type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>Pointer to the client instance </td></tr>
    <tr><td class="paramname">CurveType</td><td>Type of elliptic curve </td></tr>
    <tr><td class="paramname">HashAddr</td><td>Address of the hash for which sign has to be generated </td></tr>
    <tr><td class="paramname">Size</td><td>Length of the hash in bytes </td></tr>
    <tr><td class="paramname">PubKeyAddr</td><td>Address of the pubilc key </td></tr>
    <tr><td class="paramname">SignAddr</td><td>Address of the signature buffer</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS On success</li>
<li>XST_FAILURE On failure </li>
</ul>
</dd></dl>
<p>Perform input parameter validation on InstancePtr. Return XST_FAILURE if input parameters are invalid</p>
<p>Link shared memory of size EcdsaParams to EcdsaParams structure for IPI usage. Validates the size of the shared memory whether the required size is available or not.</p>
<p>Send an IPI request to the PLM by using the CDO command to call XSecure_EllipticVerifySignature API and returns the status of the IPI response.</p>

<p>References <a class="el" href="group__xsecure__common__apis.html#gga48921cbba3a5713caf7d975bedbe36aca0bd0d49b5ae8ddc3957afa1a2e3cc284">XSECURE_API_ELLIPTIC_VERIFY_SIGN</a>, <a class="el" href="group__xsecure__common__apis.html#ga4dc28d692c8e56b1837e73a956ddec26">XSecure_DCacheFlushRange</a>, and <a class="el" href="group__xsecure__mailbox__apis.html#ga6ac5f0da32dd8fb5fcd15a7e65b492bb">XSecure_ProcessMailbox()</a>.</p>

<p>Referenced by <a class="el" href="group__xsecure__kat__server__apis.html#ga0bc8cabf909b4a457656573b4b701c3a">XSecure_EllipticVerifySignKat()</a>.</p>

</div>
</div>
<a class="anchor" id="ga0e90d7253656c56458e39541009e4954"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_GenSharedSecret </td>
          <td>(</td>
          <td class="paramtype">XSecure_ClientInstance *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>CrvType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u8 *&#160;</td>
          <td class="paramname"><em>PrivateKey</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u8 *&#160;</td>
          <td class="paramname"><em>PublicKey</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8 *&#160;</td>
          <td class="paramname"><em>SharedSecret</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sends IPI request to generate shared secret using Elliptic Curve Diffie–Hellman Key Exchange (ECDH) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>Pointer to the client instance </td></tr>
    <tr><td class="paramname">CrvType</td><td>Type of elliptic curve </td></tr>
    <tr><td class="paramname">PrivateKey</td><td>Pointer to the private key buffer </td></tr>
    <tr><td class="paramname">PublicKey</td><td>Pointer to the public key buffer </td></tr>
    <tr><td class="paramname">SharedSecret</td><td>Pointer to the output buffer which shall be used to store shared secret</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS On Success</li>
<li>XST_INVALID_PARAM If any input parameter is invalid.</li>
<li>XST_FAILURE If there is a failure </li>
</ul>
</dd></dl>
<p>Link shared memory of size EcdsaParams to EcdsaParams structure for IPI usage. Validates the size of the shared memory whether the required size is available or not.</p>
<p>Send an IPI request to the PLM by using the CDO command to call XSecure_GenSharedSecret API and returns the status of the IPI response.</p>

<p>References <a class="el" href="group__xsecure__common__apis.html#ga49179f0283044223009c733e01b79d5a">XSECURE_ADDR_HIGH_SHIFT</a>, <a class="el" href="group__xsecure__common__apis.html#gga48921cbba3a5713caf7d975bedbe36acab281f47d0b6c949e695c0173ff9d0dc7">XSECURE_API_GEN_SHARED_SECRET</a>, <a class="el" href="group__xsecure__common__apis.html#ga4dc28d692c8e56b1837e73a956ddec26">XSecure_DCacheFlushRange</a>, and <a class="el" href="group__xsecure__mailbox__apis.html#ga6ac5f0da32dd8fb5fcd15a7e65b492bb">XSecure_ProcessMailbox()</a>.</p>

<p>Referenced by <a class="el" href="group__xsecure__ecdsa__server__apis.html#ga5c01365d664f53f9b987711c52f7bee8">XSecure_PlatEllipticIpiHandler()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
